home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Appearance SDK 1.0.4 / Appearance Sample Code / Headers / PInterfaces / Dialogs.p < prev    next >
Encoding:
Text File  |  1999-07-16  |  21.2 KB  |  610 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Dialogs.p
  3.  
  4.      Contains:    Dialog Manager interfaces.
  5.  
  6.      Version:    Technology:    Appearance 1.0.2
  7.                  Release:    To be used with Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Dialogs;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DIALOGS__}
  28. {$SETC __DIALOGS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DialogsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __EVENTS__}
  41. {$I Events.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __MACWINDOWS__}
  44. {$I MacWindows.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __TEXTEDIT__}
  47. {$I TextEdit.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __CONTROLS__}
  50. {$I Controls.p}
  51. {$ENDC}
  52.  
  53.  
  54. {$PUSH}
  55. {$ALIGN MAC68K}
  56. {$LibExport+}
  57.  
  58.  
  59. CONST
  60.                                                                 {  new, more standard names for dialog item types }
  61.     kControlDialogItem            = 4;
  62.     kButtonDialogItem            = 4;
  63.     kCheckBoxDialogItem            = 5;
  64.     kRadioButtonDialogItem        = 6;
  65.     kResourceControlDialogItem    = 7;
  66.     kStaticTextDialogItem        = 8;
  67.     kEditTextDialogItem            = 16;
  68.     kIconDialogItem                = 32;
  69.     kPictureDialogItem            = 64;
  70.     kUserDialogItem                = 0;
  71.     kItemDisableBit                = 128;
  72.  
  73.                                                                 {  old names for dialog item types }
  74.     ctrlItem                    = 4;
  75.     btnCtrl                        = 0;
  76.     chkCtrl                        = 1;
  77.     radCtrl                        = 2;
  78.     resCtrl                        = 3;
  79.     statText                    = 8;
  80.     editText                    = 16;
  81.     iconItem                    = 32;
  82.     picItem                        = 64;
  83.     userItem                    = 0;
  84.     itemDisable                    = 128;
  85.  
  86.                                                                 {  standard dialog item numbers }
  87.     kStdOkItemIndex                = 1;
  88.     kStdCancelItemIndex            = 2;                            {  old names }
  89.     ok                            = 1;
  90.     cancel                        = 2;
  91.  
  92.                                                                 {  standard icon resource id's      }
  93.     kStopIcon                    = 0;
  94.     kNoteIcon                    = 1;
  95.     kCautionIcon                = 2;                            {  old names }
  96.     stopIcon                    = 0;
  97.     noteIcon                    = 1;
  98.     cautionIcon                    = 2;
  99.  
  100.  
  101.  
  102.  
  103. {$IFC OLDROUTINENAMES }
  104. {
  105.    These constants lived briefly on ETO 16.  They suggest
  106.    that there is only one index you can use for the OK 
  107.    item, which is not true.  You can put the ok item 
  108.    anywhere you want in the DITL.
  109. }
  110.     kOkItemIndex                = 1;
  111.     kCancelItemIndex            = 2;
  112.  
  113. {$ENDC}  {OLDROUTINENAMES}
  114.  
  115. {    Dialog Item List Manipulation Constants    }
  116.  
  117. TYPE
  118.     DITLMethod                            = SInt16;
  119.  
  120. CONST
  121.     overlayDITL                    = 0;
  122.     appendDITLRight                = 1;
  123.     appendDITLBottom            = 2;
  124.  
  125.  
  126. TYPE
  127.     StageList                            = SInt16;
  128. {  DialogRef is obsolete. Use DialogPtr instead. }
  129.     DialogRef                            = DialogPtr;
  130.     DialogRecordPtr = ^DialogRecord;
  131.     DialogRecord = RECORD
  132.         window:                    WindowRecord;
  133.         items:                    Handle;
  134.         textH:                    TEHandle;
  135.         editField:                SInt16;
  136.         editOpen:                SInt16;
  137.         aDefItem:                SInt16;
  138.     END;
  139.  
  140.     DialogPeek                            = ^DialogRecord;
  141.     DialogTemplatePtr = ^DialogTemplate;
  142.     DialogTemplate = RECORD
  143.         boundsRect:                Rect;
  144.         procID:                    SInt16;
  145.         visible:                BOOLEAN;
  146.         filler1:                BOOLEAN;
  147.         goAwayFlag:                BOOLEAN;
  148.         filler2:                BOOLEAN;
  149.         refCon:                    SInt32;
  150.         itemsID:                SInt16;
  151.         title:                    Str255;
  152.     END;
  153.  
  154.     DialogTPtr                            = ^DialogTemplate;
  155.     DialogTHndl                            = ^DialogTPtr;
  156.     AlertTemplatePtr = ^AlertTemplate;
  157.     AlertTemplate = RECORD
  158.         boundsRect:                Rect;
  159.         itemsID:                SInt16;
  160.         stages:                    StageList;
  161.     END;
  162.  
  163.     AlertTPtr                            = ^AlertTemplate;
  164.     AlertTHndl                            = ^AlertTPtr;
  165. { new type abstractions for the dialog manager }
  166.     DialogItemIndexZeroBased            = SInt16;
  167.     DialogItemIndex                        = SInt16;
  168.     DialogItemType                        = SInt16;
  169. { dialog manager callbacks }
  170.     SoundProcPtr = ProcPtr;  { PROCEDURE Sound(soundNumber: SInt16); }
  171.  
  172.     ModalFilterProcPtr = ProcPtr;  { FUNCTION ModalFilter(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: DialogItemIndex): BOOLEAN; }
  173.  
  174.     UserItemProcPtr = ProcPtr;  { PROCEDURE UserItem(theWindow: WindowPtr; itemNo: DialogItemIndex); }
  175.  
  176.     SoundUPP = UniversalProcPtr;
  177.     ModalFilterUPP = UniversalProcPtr;
  178.     UserItemUPP = UniversalProcPtr;
  179.  
  180. CONST
  181.     uppSoundProcInfo = $00000080;
  182.     uppModalFilterProcInfo = $00000FD0;
  183.     uppUserItemProcInfo = $000002C0;
  184.  
  185. FUNCTION NewSoundProc(userRoutine: SoundProcPtr): SoundUPP;
  186.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  187.     INLINE $2E9F;
  188.     {$ENDC}
  189.  
  190. FUNCTION NewModalFilterProc(userRoutine: ModalFilterProcPtr): ModalFilterUPP;
  191.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  192.     INLINE $2E9F;
  193.     {$ENDC}
  194.  
  195. FUNCTION NewUserItemProc(userRoutine: UserItemProcPtr): UserItemUPP;
  196.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  197.     INLINE $2E9F;
  198.     {$ENDC}
  199.  
  200. PROCEDURE CallSoundProc(soundNumber: SInt16; userRoutine: SoundUPP);
  201.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  202.     INLINE $205F, $4E90;
  203.     {$ENDC}
  204.  
  205. FUNCTION CallModalFilterProc(theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: DialogItemIndex; userRoutine: ModalFilterUPP): BOOLEAN;
  206.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  207.     INLINE $205F, $4E90;
  208.     {$ENDC}
  209.  
  210. PROCEDURE CallUserItemProc(theWindow: WindowPtr; itemNo: DialogItemIndex; userRoutine: UserItemUPP);
  211.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  212.     INLINE $205F, $4E90;
  213.     {$ENDC}
  214. {
  215.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  216.       • Following types are valid with Appearance 1.0 and later
  217.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  218. }
  219.  
  220. CONST
  221.                                                                 {  Alert types to pass into StandardAlert  }
  222.     kAlertStopAlert                = 0;
  223.     kAlertNoteAlert                = 1;
  224.     kAlertCautionAlert            = 2;
  225.     kAlertPlainAlert            = 3;
  226.  
  227.  
  228. TYPE
  229.     AlertType                            = SInt16;
  230.  
  231. CONST
  232.     kAlertDefaultOKText            = -1;                            {  "OK" }
  233.     kAlertDefaultCancelText        = -1;                            {  "Cancel" }
  234.     kAlertDefaultOtherText        = -1;                            {  "Don't Save" }
  235.  
  236. { StandardAlert alert button numbers }
  237.     kAlertStdAlertOKButton        = 1;
  238.     kAlertStdAlertCancelButton    = 2;
  239.     kAlertStdAlertOtherButton    = 3;
  240.     kAlertStdAlertHelpButton    = 4;
  241.  
  242.                                                                 {  Dialog Flags for use in NewFeaturesDialog or dlgx resource  }
  243.     kDialogFlagsUseThemeBackground = $01;
  244.     kDialogFlagsUseControlHierarchy = $02;
  245.     kDialogFlagsHandleMovableModal = $04;
  246.     kDialogFlagsUseThemeControls = $08;
  247.  
  248.                                                                 {  Alert Flags for use in alrx resource  }
  249.     kAlertFlagsUseThemeBackground = $01;
  250.     kAlertFlagsUseControlHierarchy = $02;
  251.     kAlertFlagsAlertIsMovable    = $04;
  252.     kAlertFlagsUseThemeControls    = $08;
  253.  
  254. { For dftb resource }
  255.     kDialogFontNoFontStyle        = 0;
  256.     kDialogFontUseFontMask        = $0001;
  257.     kDialogFontUseFaceMask        = $0002;
  258.     kDialogFontUseSizeMask        = $0004;
  259.     kDialogFontUseForeColorMask    = $0008;
  260.     kDialogFontUseBackColorMask    = $0010;
  261.     kDialogFontUseModeMask        = $0020;
  262.     kDialogFontUseJustMask        = $0040;
  263.     kDialogFontUseAllMask        = $00FF;
  264.     kDialogFontAddFontSizeMask    = $0100;
  265.     kDialogFontUseFontNameMask    = $0200;
  266.  
  267.  
  268. TYPE
  269.     AlertStdAlertParamRecPtr = ^AlertStdAlertParamRec;
  270.     AlertStdAlertParamRec = RECORD
  271.         movable:                BOOLEAN;                                {  Make alert movable modal  }
  272.         helpButton:                BOOLEAN;                                {  Is there a help button?  }
  273.         filterProc:                ModalFilterUPP;                            {  Event filter  }
  274.         defaultText:            StringPtr;                                {  Text for button in OK position  }
  275.         cancelText:                StringPtr;                                {  Text for button in cancel position  }
  276.         otherText:                StringPtr;                                {  Text for button in left position  }
  277.         defaultButton:            SInt16;                                    {  Which button behaves as the default  }
  278.         cancelButton:            SInt16;                                    {  Which one behaves as cancel (can be 0)  }
  279.         position:                UInt16;                                    {  Position (kWindowDefaultPosition in this case  }
  280.                                                                         {  equals kWindowAlertPositionParentWindowScreen)  }
  281.     END;
  282.  
  283.     AlertStdAlertParamPtr                = ^AlertStdAlertParamRec;
  284. {  ——— end Appearance 1.0 or later stuff }
  285.  
  286.  
  287.  
  288.  
  289.  
  290. {
  291.     NOTE: Code running under MultiFinder or System 7.0 or newer
  292.     should always pass NULL to InitDialogs.
  293. }
  294. PROCEDURE InitDialogs(ignored: UNIV Ptr);
  295.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  296.     INLINE $A97B;
  297.     {$ENDC}
  298. PROCEDURE ErrorSound(soundProc: SoundUPP);
  299.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  300.     INLINE $A98C;
  301.     {$ENDC}
  302. FUNCTION NewDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogPtr;
  303.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  304.     INLINE $A97D;
  305.     {$ENDC}
  306. FUNCTION GetNewDialog(dialogID: SInt16; dStorage: UNIV Ptr; behind: WindowPtr): DialogPtr;
  307.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  308.     INLINE $A97C;
  309.     {$ENDC}
  310. FUNCTION NewColorDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogPtr;
  311.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  312.     INLINE $AA4B;
  313.     {$ENDC}
  314. PROCEDURE CloseDialog(theDialog: DialogPtr);
  315.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  316.     INLINE $A982;
  317.     {$ENDC}
  318. PROCEDURE DisposeDialog(theDialog: DialogPtr);
  319.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  320.     INLINE $A983;
  321.     {$ENDC}
  322. PROCEDURE ModalDialog(modalFilter: ModalFilterUPP; VAR itemHit: DialogItemIndex);
  323.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  324.     INLINE $A991;
  325.     {$ENDC}
  326. FUNCTION IsDialogEvent({CONST}VAR theEvent: EventRecord): BOOLEAN;
  327.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  328.     INLINE $A97F;
  329.     {$ENDC}
  330. FUNCTION DialogSelect({CONST}VAR theEvent: EventRecord; VAR theDialog: DialogPtr; VAR itemHit: DialogItemIndex): BOOLEAN;
  331.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  332.     INLINE $A980;
  333.     {$ENDC}
  334. PROCEDURE DrawDialog(theDialog: DialogPtr);
  335.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  336.     INLINE $A981;
  337.     {$ENDC}
  338. PROCEDURE UpdateDialog(theDialog: DialogPtr; updateRgn: RgnHandle);
  339.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  340.     INLINE $A978;
  341.     {$ENDC}
  342. PROCEDURE HideDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  343.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  344.     INLINE $A827;
  345.     {$ENDC}
  346. PROCEDURE ShowDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  347.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  348.     INLINE $A828;
  349.     {$ENDC}
  350. FUNCTION FindDialogItem(theDialog: DialogPtr; thePt: Point): DialogItemIndexZeroBased;
  351.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  352.     INLINE $A984;
  353.     {$ENDC}
  354. PROCEDURE DialogCut(theDialog: DialogPtr);
  355. PROCEDURE DialogPaste(theDialog: DialogPtr);
  356. PROCEDURE DialogCopy(theDialog: DialogPtr);
  357. PROCEDURE DialogDelete(theDialog: DialogPtr);
  358. FUNCTION Alert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  359.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  360.     INLINE $A985;
  361.     {$ENDC}
  362. FUNCTION StopAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  363.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  364.     INLINE $A986;
  365.     {$ENDC}
  366. FUNCTION NoteAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  367.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  368.     INLINE $A987;
  369.     {$ENDC}
  370. FUNCTION CautionAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
  371.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  372.     INLINE $A988;
  373.     {$ENDC}
  374. PROCEDURE GetDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex; VAR itemType: DialogItemType; VAR item: Handle; VAR box: Rect);
  375.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  376.     INLINE $A98D;
  377.     {$ENDC}
  378. PROCEDURE SetDialogItem(theDialog: DialogPtr; itemNo: DialogItemIndex; itemType: DialogItemType; item: Handle; {CONST}VAR box: Rect);
  379.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  380.     INLINE $A98E;
  381.     {$ENDC}
  382. PROCEDURE ParamText(param0: ConstStr255Param; param1: ConstStr255Param; param2: ConstStr255Param; param3: ConstStr255Param);
  383.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  384.     INLINE $A98B;
  385.     {$ENDC}
  386. PROCEDURE SelectDialogItemText(theDialog: DialogPtr; itemNo: DialogItemIndex; strtSel: SInt16; endSel: SInt16);
  387.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  388.     INLINE $A97E;
  389.     {$ENDC}
  390. PROCEDURE GetDialogItemText(item: Handle; VAR text: Str255);
  391.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  392.     INLINE $A990;
  393.     {$ENDC}
  394. PROCEDURE SetDialogItemText(item: Handle; text: ConstStr255Param);
  395.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  396.     INLINE $A98F;
  397.     {$ENDC}
  398. FUNCTION GetAlertStage: SInt16;
  399.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  400.     INLINE $3EB8, $0A9A;
  401.     {$ENDC}
  402. PROCEDURE SetDialogFont(value: SInt16);
  403.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  404.     INLINE $31DF, $0AFA;
  405.     {$ENDC}
  406. PROCEDURE ResetAlertStage;
  407.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  408.     INLINE $4278, $0A9A;
  409.     {$ENDC}
  410.  
  411. PROCEDURE AppendDITL(theDialog: DialogPtr; theHandle: Handle; method: DITLMethod);
  412. FUNCTION CountDITL(theDialog: DialogPtr): DialogItemIndex;
  413. PROCEDURE ShortenDITL(theDialog: DialogPtr; numberItems: DialogItemIndex);
  414. FUNCTION StdFilterProc(theDialog: DialogPtr; VAR event: EventRecord; VAR itemHit: DialogItemIndex): BOOLEAN;
  415. FUNCTION GetStdFilterProc(VAR theProc: ModalFilterUPP): OSErr;
  416.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  417.     INLINE $303C, $0203, $AA68;
  418.     {$ENDC}
  419. FUNCTION SetDialogDefaultItem(theDialog: DialogPtr; newItem: DialogItemIndex): OSErr;
  420.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  421.     INLINE $303C, $0304, $AA68;
  422.     {$ENDC}
  423. FUNCTION SetDialogCancelItem(theDialog: DialogPtr; newItem: DialogItemIndex): OSErr;
  424.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  425.     INLINE $303C, $0305, $AA68;
  426.     {$ENDC}
  427. FUNCTION SetDialogTracksCursor(theDialog: DialogPtr; tracks: BOOLEAN): OSErr;
  428.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  429.     INLINE $303C, $0306, $AA68;
  430.     {$ENDC}
  431.  
  432.  
  433. {
  434.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  435.       • Appearance Dialog Routines (available only with Appearance 1.0 and later)
  436.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  437. }
  438.  
  439. FUNCTION NewFeaturesDialog(inStorage: UNIV Ptr; {CONST}VAR inBoundsRect: Rect; inTitle: ConstStr255Param; inIsVisible: BOOLEAN; inProcID: SInt16; inBehind: WindowPtr; inGoAwayFlag: BOOLEAN; inRefCon: SInt32; inItemListHandle: Handle; inFlags: UInt32): DialogPtr;
  440.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  441.     INLINE $303C, $110C, $AA68;
  442.     {$ENDC}
  443. FUNCTION AutoSizeDialog(inDialog: DialogPtr): OSErr;
  444.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  445.     INLINE $303C, $020D, $AA68;
  446.     {$ENDC}
  447. FUNCTION StandardAlert(inAlertType: AlertType; inError: StringPtr; inExplanation: StringPtr; inAlertParam: AlertStdAlertParamPtr; VAR outItemHit: SInt16): OSErr;
  448.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  449.     INLINE $303C, $090E, $AA68;
  450.     {$ENDC}
  451. FUNCTION GetDialogItemAsControl(inDialog: DialogPtr; inItemNo: SInt16; VAR outControl: ControlHandle): OSErr;
  452.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  453.     INLINE $303C, $050F, $AA68;
  454.     {$ENDC}
  455. FUNCTION MoveDialogItem(inDialog: DialogPtr; inItemNo: SInt16; inHoriz: SInt16; inVert: SInt16): OSErr;
  456.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  457.     INLINE $303C, $0510, $AA68;
  458.     {$ENDC}
  459. FUNCTION SizeDialogItem(inDialog: DialogPtr; inItemNo: SInt16; inWidth: SInt16; inHeight: SInt16): OSErr;
  460.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  461.     INLINE $303C, $0511, $AA68;
  462.     {$ENDC}
  463. {$IFC OLDROUTINENAMES }
  464. PROCEDURE DisposDialog(theDialog: DialogPtr);
  465.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  466.     INLINE $A983;
  467.     {$ENDC}
  468. PROCEDURE UpdtDialog(theDialog: DialogPtr; updateRgn: RgnHandle);
  469.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  470.     INLINE $A978;
  471.     {$ENDC}
  472. PROCEDURE GetDItem(theDialog: DialogPtr; itemNo: DialogItemIndex; VAR itemType: DialogItemType; VAR item: Handle; VAR box: Rect);
  473.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  474.     INLINE $A98D;
  475.     {$ENDC}
  476. PROCEDURE SetDItem(theDialog: DialogPtr; itemNo: DialogItemIndex; itemType: DialogItemType; item: Handle; {CONST}VAR box: Rect);
  477.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  478.     INLINE $A98E;
  479.     {$ENDC}
  480. PROCEDURE HideDItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  481.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  482.     INLINE $A827;
  483.     {$ENDC}
  484. PROCEDURE ShowDItem(theDialog: DialogPtr; itemNo: DialogItemIndex);
  485.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  486.     INLINE $A828;
  487.     {$ENDC}
  488. PROCEDURE SelIText(theDialog: DialogPtr; itemNo: DialogItemIndex; strtSel: SInt16; endSel: SInt16);
  489.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  490.     INLINE $A97E;
  491.     {$ENDC}
  492. PROCEDURE GetIText(item: Handle; VAR text: Str255);
  493.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  494.     INLINE $A990;
  495.     {$ENDC}
  496. PROCEDURE SetIText(item: Handle; text: Str255);
  497.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  498.     INLINE $A98F;
  499.     {$ENDC}
  500. FUNCTION FindDItem(theDialog: DialogPtr; thePt: Point): DialogItemIndexZeroBased;
  501.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  502.     INLINE $A984;
  503.     {$ENDC}
  504. FUNCTION NewCDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogPtr;
  505.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  506.     INLINE $AA4B;
  507.     {$ENDC}
  508. PROCEDURE DlgCut(theDialog: DialogPtr);
  509. PROCEDURE DlgPaste(theDialog: DialogPtr);
  510. PROCEDURE DlgCopy(theDialog: DialogPtr);
  511. PROCEDURE DlgDelete(theDialog: DialogPtr);
  512. PROCEDURE SetDAFont(fontNum: SInt16);
  513.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  514.     INLINE $31DF, $0AFA;
  515.     {$ENDC}
  516.  
  517.  
  518.  
  519. {$ENDC}  {OLDROUTINENAMES}
  520.  
  521. {
  522.     *****************************************************************************
  523.     *                                                                           *
  524.     * The conditional STRICT_DIALOGS has been removed from this interface file. *
  525.     * The accessor macros to a DialogRecord are no longer necessary.            *
  526.     *                                                                           *
  527.     * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  528.     *                                                                           *
  529.     *****************************************************************************
  530.  
  531.     Details:
  532.     The original purpose of the STRICT_ conditionals and accessor macros was to
  533.     help ease the transition to Copland.  Shared data structures are difficult
  534.     to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  535.     WindowRecord and other data structures, we would begin the migration to the
  536.     discipline wherein system data structures are completely hidden from
  537.     applications.
  538.     
  539.     After many design reviews, we finally concluded that with this sort of
  540.     migration, the system could never tell when an application was no longer
  541.     peeking at a WindowRecord, and thus the data structure might never become
  542.     system owned.  Additionally, there were many other limitations in the
  543.     classic toolbox that were begging to be addressed.  The final decision was
  544.     to leave the traditional toolbox as a compatibility mode.
  545.     
  546.     We also decided to use the Handle and Ptr based types in the function
  547.     declarations.  For example, NewWindow now returns a WindowPtr rather than a
  548.     WindowRef.  The Ref types are still defined in the header files, so all
  549.     existing code will still compile exactly as it did before.  There are
  550.     several reasons why we chose to do this:
  551.     
  552.     - The importance of backwards compatibility makes it unfeasible for us to
  553.     enforce real opaque references in the implementation anytime in the
  554.     foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  555.     ControlRef, etc.) in the documentation and header files would always be a
  556.     fake veneer of opacity.
  557.     
  558.     - There exists a significant base of books and sample code that neophyte
  559.     Macintosh developers use to learn how to program the Macintosh.  These
  560.     books and sample code all use direct data access.  Introducing opaque data
  561.     types at this point would confuse neophyte programmers more than it would
  562.     help them.
  563.     
  564.     - Direct data structure access is used by nearly all Macintosh developers. 
  565.     Changing the interfaces to reflect a false opacity would not provide any
  566.     benefit to these developers.
  567.     
  568.     - Accessor functions are useful in and of themselves as convenience
  569.     functions, without being tied to opaque data types.  We will complete and
  570.     document the Windows and Dialogs accessor functions in an upcoming release
  571.     of the interfaces.
  572. }
  573.  
  574.  
  575.  
  576. PROCEDURE CouldDialog(dialogID: SInt16);
  577.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  578.     INLINE $A979;
  579.     {$ENDC}
  580. PROCEDURE FreeDialog(dialogID: SInt16);
  581.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  582.     INLINE $A97A;
  583.     {$ENDC}
  584. PROCEDURE CouldAlert(alertID: SInt16);
  585.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  586.     INLINE $A989;
  587.     {$ENDC}
  588. PROCEDURE FreeAlert(alertID: SInt16);
  589.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  590.     INLINE $A98A;
  591.     {$ENDC}
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600. {$ALIGN RESET}
  601. {$POP}
  602.  
  603. {$SETC UsingIncludes := DialogsIncludes}
  604.  
  605. {$ENDC} {__DIALOGS__}
  606.  
  607. {$IFC NOT UsingIncludes}
  608.  END.
  609. {$ENDC}
  610.